// 联合类型通过管道（|）将变量设置多种类型，赋值是可以根据设置的类型进行赋值
let a: string | number | null;
a = 12;
console.log(a);
a = "helloWorld";
console.log(a);
let b: number[] | string[];
b = [1, 2, 3];
console.log(b[0]);
b = ["hello", "world"];
console.log(b[0]);
